package MethodApplication.MethodDemo2;

public class ABS {
    public static int methodABS(int i,MethodABS a){
        return a.abs(i);
    }

    public static void main(String[] args) {
       /* int number = methodABS(-10, (i) -> {
            return Math.abs(i);
        });*/

        int number = methodABS(-10, (i) ->  Math.abs(i)  );
        System.out.println(number);
        //通过类名的方法引用
        int i = methodABS(-11, Math::abs);
        System.out.println(i);
    }
}
